package com.douwong.student.model;

import java.io.Serializable;

/**
 * apk信息
 */
public class AppInfos implements Serializable,
        Comparable<AppInfos> {
    private static final long serialVersionUID = 1L;
    public String appName = null;
    public String packageName = null;
    public String versionName = null;
    public int versionCode = 0;
    //Drawable不能序列化到本地,图标在adapter中动态获取
    //public Drawable appIcon = null;
    public String appDownloadUrl;
    public String appIcoDownloadUrl;
    public String appPackageName;
    public int appPageCode;
    public int appType;
    public String createtime;
    public int id;
    public int statue;
    public int ynControl;
    public int ynShow;
    public boolean isLocal = false;
    public boolean isInner = false;

    @Override
    public int compareTo(AppInfos another) {

        if (this.id == 0 && another.id == 0) {

            if (this.isLocal) {
                return 1;
            }

            return -1;

        } else if (this.id == 0 && another.id != 0) {

            return 1;

        } else if (this.id != 0 && another.id == 0) {
            return -1;
        } else if (this.id != 0 && another.id != 0) {
            return this.id-another.id;
        }
    return 0;

    }


    //	"appDownloadUrl": "http://www.eclassedu.com/edu/index/login.html",
    //    "appIcoDownloadUrl": "http://www.eclassedu.com/edu/index/login.html",
    //    "appName": "资源库",
    //    "appPackageName": "online",
    //    "appPageCode": 6,
    //    "appPassword": "123456",
    //    "appType": 748,
    //    "createtime": "2016-01-19 17:58:52",
    //    "id": 7,
    //    "status": 0,
    //    "ynControl": 1,
    //    "ynShow": 1


}
